package com.wumz.spring.write.v2.demo.service.impl;

import com.wumz.spring.write.v2.demo.service.IDemoService;
import com.wumz.spring.write.v2.framework.annotation.MyService;
import lombok.SneakyThrows;

/**
 * 业务逻辑
 * Created by wumz on 2020/9/26 13:41
 */
@MyService
public class DemoServiceImpl implements IDemoService {

    public String get(String name) {
        return "My name is " + name + ",from service.";
    }

    /**
     * 增加
     */
    @Override
    public String add(String name,String addr) {
        return "modifyService add,name=" + name + ",addr=" + addr;
    }

    /**
     * 修改
     */
    @Override
    public String edit(Integer id,String name) {
        return "modifyService edit,id=" + id + ",name=" + name;
    }

    /**
     * 删除
     */
    @Override
    public String remove(Integer id) {
        return "modifyService id=" + id;
    }

    @Override
    public void query(String name) throws Exception {
        throw new Exception("这是Tom故意抛出来的异常");
    }
}
